package leo.weixin.entity.message;

import com.thoughtworks.xstream.annotations.XStreamAlias;
import lombok.Data;

import java.util.Map;

/**
 * 回复消息的封装
 */
@Data
@XStreamAlias("xml")
public class
BaseMessage {
    @XStreamAlias("ToUserName")
    private String toUserName;
    @XStreamAlias("FromUserName")//接收方帐号（收到的OpenID）
    private String fromUserName;	//开发者微信号
    @XStreamAlias("CreateTime")
    private String createTime;		//消息创建时间 （整型）
    @XStreamAlias("MsgType")
    private String msgType;		//消息类型
    public BaseMessage(Map<String,String> requestMap) {
        this.toUserName = requestMap.get("FromUserName");
        this.fromUserName = requestMap.get("ToUserName");
        this.createTime = System.currentTimeMillis()/1000+"";
    }
}
